<?php
session_start();
$_GET["cookie"]=isset($_GET["cookie"])?$_GET["cookie"]:null;
if ($_GET["cookie"] == "out") {
    setcookie("cookie", "out",time()+3600,"/");
    $_SESSION = array();
    session_destroy();  //退出有错误
    echo "<script language=\"javascript\">location.href='../login.html';</script>";
}
if ($_COOKIE["cookie"] == "s-ok") {
    $_SESSION["s-id"];
    $_SESSION["s-Year"];

} else {
    setcookie("cookie", "out",time()+3600,"/");
    ?>
    <script type="text/javascript">
        alert("你还未登录");
    </script>
    <?
    echo "<script language=\"javascript\">location.href='../login.html';</script>";
}
?>
